/*  1:   */ package com.atomikos.icatch.jta;
/*  2:   */ 
/*  3:   */ import java.util.Hashtable;
/*  4:   */ import javax.naming.Context;
/*  5:   */ import javax.naming.Name;
/*  6:   */ import javax.naming.Reference;
/*  7:   */ import javax.naming.spi.ObjectFactory;
/*  8:   */ 
/*  9:   */ public class UserTransactionFactory
/* 10:   */   implements ObjectFactory
/* 11:   */ {
/* 12:   */   public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment)
/* 13:   */     throws Exception
/* 14:   */   {
/* 15:54 */     Object ret = null;
/* 16:55 */     if ((obj == null) || (!(obj instanceof Reference))) {
/* 17:56 */       return null;
/* 18:   */     }
/* 19:58 */     Reference ref = (Reference)obj;
/* 20:59 */     if (ref.getClassName().equals("com.atomikos.icatch.jta.UserTransactionImp")) {
/* 21:61 */       ret = new UserTransactionImp();
/* 22:62 */     } else if (ref.getClassName().equals("com.atomikos.icatch.jta.J2eeUserTransaction")) {
/* 23:64 */       ret = new J2eeUserTransaction();
/* 24:65 */     } else if (ref.getClassName().equals("javax.transaction.UserTransaction")) {
/* 25:68 */       ret = new UserTransactionImp();
/* 26:   */     } else {
/* 27:70 */       ret = null;
/* 28:   */     }
/* 29:72 */     return ret;
/* 30:   */   }
/* 31:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.UserTransactionFactory
 * JD-Core Version:    0.7.0.1
 */